fix(console): 把 system/permissions 与 Permissions 计数一并接到 sys_permission_set,收尾 #3655 第五腿 - #3728
Merged
Merged
Conversation
…n_set (#3655) Fifth and last of the five `system/*` navigation targets. `system/permissions` and the hub's Permissions count were both held back (PR #3673 / #3680) because the framework splits this console's "Permissions" into `sys_capability` (ADR-0066 layer 1, the definition registry) and `sys_permission_set` (layer 2, the grant container the permissions docs call "the only capability container"). objectui#3655 decided it as `sys_permission_set`: the card reads "Manage permission rules and assignments", and rules-and-assignments is layer 2. - route: `system/permissions` -> `SystemObjectRedirect objectName="sys_permission_set"` - count: `dataSource.find('sys_permission')` -> `'sys_permission_set'` - the two MEASUREMENT pins written to be replaced when this landed are replaced; the length-split fact they also carried is re-pinned on segments that are still undeclared in both route tables. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
yinlianghui
marked this pull request as ready for review
August 8, 2026 10:06
This was referenced Aug 8, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3655
第五条也是最后一条腿。按 #3655 的 PM 裁决(维护者已授权代裁,裁决评论)落地 A ——
sys_permission_set;C(卡片墙连同 hub 退场)保留为独立产品项,不阻塞,本 PR 未替它做任何事。先复核前提(逐条对
origin/main@36bf20235与框架../objectstack@b4872a868)裁决的结论成立,但它引用的一条论据不成立 —— 照实写在这里,并已写进代码注释,免得下一个读者继承它:
sys_permission_set是框架注册的对象packages/plugins/plugin-security/src/objects/sys-permission-set.object.ts:16name: 'sys_permission_set'security-plugin.ts:445{ id: 'nav_permission_sets', type: 'object', label: 'Permission Sets', objectName: 'sys_permission_set', icon: 'lock' },contribute 进app: 'setup'/group_access_controlsys_permission(不含_set)仍然不是对象content/docs/permissions/permissions-matrix.mdx:64等四处;administrator-guide.mdx:25展开为「object CRUD、field security、access depth、system capabilities」managedBy: 'config'+protection.lock: 'no-overlay'(sys-permission-set.object.ts:21,24-25/sys-capability.object.ts:32,35-36),且两个 docblock 都写明锁的是 schema、租户/管理员可以加行(capability 那句原文:「The platform/packages DEFINE capabilities; admins EXTEND them in Setup」)。「对 B 做管理员增删没有意义」不成立。结论没有因此改变,换了一条更硬的论据:ADR-0066 的三层分离 —— capability(层 1,「能做什么」的定义目录)/ assignment(层 2)/ requirement(层 3)。
sys_capability是层 1,sys_permission_set是层 2;卡片文案「Manage permission rules and assignments」正是层 2,而层 1 是 permission set 按 name 引用的东西,不是被授予的东西。这条写进了AppContent.tsx的路由块注释,连同上面那条订正。当前 main 上 permissions 腿的三处现状也逐条复核成立:
AppContent.tsx的「absent on purpose」注释、systemHubRoutes.test.tsx钉住的未变落点、counts.test.tsx钉住的恒 0。五腿终局表(实测落点,有应用分支)
system/usersRouteNotFound(5 字)…/sys_usersystem/organizations…/system/record/organizations,RecordDetailView收到objectName:"system"…/sys_organizationsystem/rolesRouteNotFound(5 字)…/sys_positionsystem/positions…/system/record/positions…/sys_positionsystem/permissions…/system/record/permissions,记录页对象名system…/sys_permission_set计数侧同步:
dataSource.find('sys_permission')→'sys_permission_set'。#3680 已把 Organizations 从sys_org改到sys_organization,sys_permission是当时唯一留着的错名;本 PR 之后五个名字全部是框架注册的名字,这一点由那条 audit 用例的一行断言机械保证(见下)。钉翻转对照(替换不并存,#3609 纪律)
派发单点了两处必翻。实测另有六处断言钉在同一条被改的肢体上 —— 逐条判定处置,不批量重拼:
systemHubRoutes.test.tsxMEASUREMENTsystem/permissions still lands on a record of the object systemit.each的一跳直达断言(第 5 行)counts.test.tsxMEASUREMENTPermissions still reads 0 while both candidate objects hold rows5 permissions真实计数 + 不查sys_permission/ 不查sys_capabilitysystemHubRoutes.test.tsx零应用it.eachpermissions → sys_permission_setextraRoutes与extraRoutesNoApp,新路由在两个分支都生效systemHubRoutes.test.tsx零应用 MEASUREMENTsystem/permissions断言「无应用时落 Page not found、绝不落记录页」system/workgroupsShorthandRecordRedirect,长词也不会变记录页」。permissions 一旦声明就必红,而事实仍然成立 —— 需要一个仍未声明的长词systemHubRoutes.test.tsx长度分叉 MEASUREMENTpermissions(11 字)被判成 record id」由 #1 那条兼任system/workgroups一条接手teams(5)/workgroups(10) 是同一概念的两种长度、两块不同的失败屏 —— 比原来用真缺口 URL 当标本更稳counts.test.tsxMEASUREMENT「未注册对象与真空对象徽章相同」+ #3679 的三行矩阵用例sys_permission(压根不存在的名字)当「未注册」标本delete state.registry.sys_permission_set,即没装 plugin-security 的部署counts.test.tsx#3679 的邻卡隔离用例0 permissions5 permissionscounts.test.tsxaudit 用例sys_permission;filter(不在框架里)期望['sys_permission']sys_permission_set/ 期望[]QUERIED_OBJECT_NAMES(#3679 的全失败用例用它装失败)同步改名,否则会给一个页面不再查询的名字装失败,而真实的sys_permission_set照常答复 —— 那条用例会以假红的方式报出来。其余断言一行未改。
逆向验证(两个扰动,方向都先写死后运行)
扰动 A —— 删掉新增那行路由声明(保留计数改名)
预测:
2 failed | 22 passed。 红的只应是两条 permissions 落点(有应用一跳、零应用空状态),方向是回到旧落点;而 4/5 两条workgroupsMEASUREMENT、其余四腿、以及 counts 全 9 条都不该动 —— 它们不经过这行路由。这点照实预测,不假装 MEASUREMENT 会跟着红。实测逐条吻合,失败现场直接打印出修前的屏幕:
扰动 B —— 计数名退回
sys_permission(保留路由)方向与 A 不同,单独预测。预测:
4 failed | 20 passed—— audit 用例(调用清单 diff)、新的5 permissions用例、#3679 邻卡隔离用例(permissions 邻卡回 0)、#3679 全失败用例(失败装在页面不再查询的名字上,sys_permission照常 resolve 空 → 徽章0 permissions冒出来)。并且明确预测两条
0 permissions用例保持绿,而且是「因为什么都没产生所以绿」:上表 #6 的两条把sys_permission_set从 registry 里删掉当「未注册」标本,而退回后查的sys_permission同样未注册 —— 两种错法在这条 fixture 上同形。这不是覆盖,是这条钉子的已知盲区,写在这里而不是留给下一个读者。实测逐条吻合:
#3679 落的错误态断言不受两个扰动影响的部分(500 单卡致盲、三行矩阵)全程绿,回归无扰动。
测试
从仓库根跑(AGENTS.md §怎么跑测试),重活走共享 flock +
--max-old-space-size=4096+--maxWorkers=2:pnpm exec vitest run --project '@object-ui/console'→ 27 files / 247 tests passed(fix(console): System Hub 计数失败回落 null 而非冒充 0,单卡隔离 (#3679) #3686 记录的 245 + 本 PR 净增 2:systemHubRoutes 13 → 15,counts 9 → 9)2 files / 24 tests passedpnpm --workspace-concurrency=2 --filter @object-ui/console type-check→ 通过(新树里先--filter '@object-ui/console^...' build建好依赖)pnpm --workspace-concurrency=2 --filter @object-ui/console lint→ 0 errors / 190 warnings,与 fix(console): 把已退场的 system/{users,organizations,roles,positions} 四条 URL 声明为重定向,直达框架系统对象 (#3655) #3673 / fix(console): System Hub 的 Organizations 计数改查框架真名 sys_organization,Permissions 半只钉不修 (#3670) #3680 / fix(console): System Hub 计数失败回落 null 而非冒充 0,单卡隔离 (#3679) #3686 记录的数目一致,本次零新增node scripts/check-control-bytes.mjs→ OK(3684 个文件);check-changeset-no-major.mjs/check-changeset-fixed.mjs→ OKgrep -naP控制字符类零命中(changeset 是新文件,门禁只扫已跟踪文件,故必须自扫)消费半径清扫:全仓
system/permissions的产出者与断言者只有本 PR 这四个文件(SystemHubPage.tsx:246的 href + 路由 + 两个测试);packages/**零命中,两个 sidebar 不产出 permissions 条目(#3655 正文即如此:这一条只由 System Hub 卡片产出)。hub-card-permissionstestid 全仓只有counts.test.tsx断言。sys_permission_set在本仓此前零引用。文件面
apps/console/src/AppContent.tsx—— 一行路由声明 + 把「absent on purpose」注释换成裁决记录(含上面那条论据订正)apps/console/src/__tests__/AppContent.systemHubRoutes.test.tsx—— 钉翻转 Implement visual designer for Object UI schemas #1/Add public roadmap, VitePress documentation site, and GitHub Pages deployment #3/Add default props to all components to prevent collapse in designer #4/Implement component reordering via drag-and-drop in designer canvas #5apps/console/src/pages/system/SystemHubPage.tsx—— 一行对象名 + 注释按事实更新apps/console/src/pages/system/__tests__/SystemHubPage.counts.test.tsx—— 钉翻转 Add automated testing infrastructure and CI/CD workflows #2/Fix documentation deployment for www.objectui.org #6/构建一个 **Live Playground (实时演练场)** (用于展示引擎能力) #7/feat: add live playground for interactive schema demonstration #8.changeset/system-hub-permissions-leg-3655.md—— patch(用户可见:Permissions 入口可达 + 计数真实)⛔ 未触碰:
ROADMAP.md(#3704 在途)、doc-version-claims ledger(#3708 在途)、两个 sidebar 文件、ShorthandRecordRedirect/looksLikeRecordId的判定逻辑、packages/app-shell的任何路由声明、sys_capability相关的任何东西。遗留(只报不改)
countLabel仍是permissions,而计数现在是 permission set 的行数(fixture 下读作「5 permissions」)。这是裁决 A 明确接受的过渡期语义(卡片自述「Manage permission rules and assignments」,permission set 正是那个容器),终局由 C 一并带走,故未改文案、未另立单 —— 若 PM 认为该单独跟踪,请裁。ROADMAP.md里 permissions 腿的中性表述在 docs(ROADMAP): P1.12 的 Routes / Tests 两个子块仍把已退场的 PermissionManagementPage 记成已完成(与 #3700 同源、在其文件面之外) #3704 落地后应按本 PR 的新现实更新;本 PR 按派发要求未碰该文件。🤖 Generated with Claude Code
https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
Generated by Claude Code